package org.dey.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.dey.pojo.RenQunFenLei;
import org.dey.pojo.RiskAssessment;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hg
 * @date 2022/4/6
 * @classname
 */
@Repository
public interface RenqunfeileiMapper extends BaseMapper<RenQunFenLei> {

    @Select(" SELECT tra.raidd traid ,tm.id tmid, tm.name,tra.`calmness`,tra.`Deficiency_of_Qi`,tra.`Deficiency_of_Yang`,\n" +
            " tra.`Deficiency_of_Yin`, tra.`Deficiency_of_Phlegm`,tra.`Hygrothermal_substance`,\n" +
            " tra.`Blood_stasis_substance`,tra.`Stagnation_of_Qi`,tra.`Special_temperament`\n" +
            " FROM t_risk_assessment tra INNER JOIN t_member tm ON tra.raid = tm.file_number  WHERE tra.`zhuangtai` = \"未分类\"")
    @Results(
            id = "RenqunfeileiMapper" , value = {
                    @Result(column = "traid", property = "raidd"),
                    @Result(column = "tmid", property = "id"),
                    @Result(column = "name", property = "raname")
    }
    )
    List<RiskAssessment> renqunfeileiXx();

    @Update(" UPDATE t_risk_assessment SET zhuangtai = \"已分类\" WHERE raidd = #{id3}")
    int updaterazt(int id3);
}
